<?php
// 本类由系统自动生成，仅供测试用途
class CollectAction extends HomeAction {
   
     public  function index(){
        //查询相关征集信息
        $collect=M('Collect');
        $collect_list=$collect->where()->field('cid,group_id,group_name,title,content,count,end_time,create_time,state')->order('cid desc')->select();
        // dump($collect_list);
        $this->assign('collect_list',$collect_list);
        $this->display('collects');
    }
  
    public function group_collects(){
        
         $collect=M('Collect');
         $data['cid']=$_GET['cid'];
         $collect_list=$collect->where($data)->find();
        // dump($collect_list);  
         $keyword = urlencode($collect_list['key_word']); 
         $keydata = explode("%2C",$keyword);   
         $this->assign('keyword',$keydata);
         $this->assign('collect',$collect_list);
         
         $Deliver_collect=D('Deliver_collectView');
         //$data['gid']=$_GET['gid'];aid 	uid 	group_id 群id	uname 用户名	create_time 	name 文章名字	content 
         //	link 原链接	group_name 群名字	use_count 	useless_count 	type 原创,转载	parent_id 原文章id	state
         $cdata['for_id']=$_GET['cid'];
         $cdata['kind']='keyword';
         $collectlist=$Deliver_collect->where($cdata)->select();
         
         //dump($Deliver_collect);
          // dump($collectlist);
          $this->assign('collect_list',$collectlist);
          $this->display();
          
    }
}